import requests
from lxml import etree

git_urls = {
    '卜佳': 'https://gitee.com/bujia0629/meiduo_project.git',
    '陈鼎': 'https://gitee.com/chendin/meiduo.git',
    '陈思君': 'https://gitee.com/chensijun/meiduo.git',
    '高帆': 'https://gitee.com/altair_10/meiduo_mall.git',
    '何高远': 'https://gitee.com/KoYr/meduo.git',
    '洪苗桂': 'https://gitee.com/hongmiaogui/meiduo_project03.git',
    '蒋剑叶': 'https://gitee.com/jy_06/meiduo_project.git',
    '李超': 'https://gitee.com/pythonlichao/',
    '李世云': 'https://gitee.com/li_shi_yun/meiduo_project.git',
    '梁世浩': 'https://gitee.com/liang_shi_hao/meiduo_project.git',
    '廖远明': 'https://gitee.com/z2692140936/meiduo_project.git',
    '凌春林': 'https://gitee.com/ling_chun_lin/meiduo_project01.git',
    '刘浩': 'https://gitee.com/liuyingxiongya/meiduo_project.git',
    '刘星体': 'https://gitee.com/liuxingti/meiduo_mall_project.git',
    '彭禹均': 'https://gitee.com/peng_yu_jun/meiduo_project.git',
    '阮子劲': 'https://gitee.com/jimemmmm/meiduo.git',
    '施自豪': 'https://gitee.com/razorwind/meiduo_project.git',
    '王向坤': 'https://gitee.com/wangxiangkun/meiduoshangcheng.git',
    '巫佳燕': 'https://gitee.com/gzpy15_wujiayan/meiduo_project.git',
    '吴启聪': 'https://gitee.com/patr1ck/Patrick.git',
    '严向栋': 'https://gitee.com/yanxiangdong/meiduo_project02.git',
    '余松林': 'https://gitee.com/michaelyyy/P10.git',
    '赵际钦': 'https://gitee.com/zhao_ji_qin/meiduo_project.git',
    '周财坚': 'https://gitee.com/zhoucaijian/meiduo_mall.git',
}
{

    '雷鸣': '',
    '雷震': '',
}
for name, git_url in git_urls.items():
    name = name[0]+'　'+name[-1] if len(name)<3 else name
    response = requests.get(git_url)
    html = etree.HTML(response.content.decode())
    time_data = html.xpath('//*[@id="git-project-info"]/div[1]/span')
    content_data = html.xpath('//*[@id="git-project-info"]/div[1]/a[2]')
    try:
        print('% 3s,最近更新时间:%s, 最近更新内容:%s' %
              (name, time_data[0].attrib['datetime'], content_data[0].text))
    except Exception as e:
        print('%s,git信息获取失败' % name)
